﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace teacherplanner
{
    public partial class EditClassDetails : Form
    {
        public EditClassDetails(int lessonNum, string oldText)
        {
            InitializeComponent();
            textBox1.Text = oldText;
            textBox1.Tag = lessonNum;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String[] sqlString = new String[1];
            
            sqlString[0] = "UPDATE LessonDetails SET ClassText = '" + textBox1.Text
            + "' WHERE LessonID = " + textBox1.Tag;

            DataBase.Edit.ApplySQLArray(sqlString);
            this.Close();
        }
    }
}
